uniform sampler2D texture0;
varying vec3 vViewer;

varying vec3 vNormal;

void main(void)
{


	vec3 normal = normalize(vNormal);
	vec3 viewer = normalize(vViewer);
   
	float angle = 0;
	if(gl_LightSource[0].position.w == 1)
		angle = max( dot(normal, normalize(gl_LightSource[0].position.xyz)), 0.0);
	
   
	vec4 lightColor = angle * gl_LightSource[0].diffuse;
	lightColor = max(lightColor, gl_LightModel.ambient);
   
   gl_FragColor = lightColor * texture2D(texture0, gl_TexCoord[0].st);
   
}